<template>
	<view class="fill-width-height" :class="$thatThemeClassName">
		<ImgEdit :extFileId="fileId" @afterRead="afterRead"/>
	</view>
</template>
<script>
	import ImgEdit from './imgEdit'
	import sharePages from '@/framework/plugins/sharePages'
	export default {
		mixins: [sharePages],
		name: 'pixelImage',
		components: {
			ImgEdit
		},
		data(){
			return {
				fileId: ''
			}
		},
		methods: {
			afterRead(file){
				this.fileId = ''
				uni.uploadFile({
					url: 'imgStore/imageTool/pixelImage',
					filePath: file.url,
					name: 'file',
					formData: {
						user: 'test'
					},
					success: (res) => {
						this.fileId = res.data?.msg || ''
					}
				})
			}
		}
	}
</script>
